﻿using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Server;
using Microsoft.TeamFoundation.VersionControl.Client;
using System;
using System.Collections.Generic;
using System.ComponentModel;

namespace SearchForWorkitemsChanges
{
    /// <summary>
    /// Contract representing a Provider for the main view model (to simplify the VM, and allow different TFS Sources - Team Explorer Caching, custom, etc.)
    /// </summary>
    internal interface ITfsInfoProvider : INotifyPropertyChanged
    {
        /// <summary>
        /// Chooses a new team project collection.
        /// That will induce the changes of <see cref="CurrentProject"/>, <see cref="CurrentCollection"/>.
        /// The event <see cref="INotifyPropertyChanged"/>.PropertyChanged will be called during the changes.
        /// </summary>
        void ChooseNewTeamProjectCollection();

        /// <summary>
        /// Gets the current project. This property raise the event <see cref="INotifyPropertyChanged"/>.PropertyChanged
        /// </summary>
        /// <value>
        /// The current project.
        /// </value>
        ProjectInfo CurrentProject { get; }

        /// <summary>
        /// Gets the current collection. This property raise the event <see cref="INotifyPropertyChanged"/>.PropertyChanged
        /// </summary>
        /// <value>
        /// The current project.
        /// </value>
        TfsTeamProjectCollection CurrentCollection { get; }

        /// <summary>
        /// Gets the changesets for the <see cref="CurrentProject"/> selected.
        /// </summary>
        /// <param name="from">The 'from' <see cref="DateTime"/>.</param>
        /// <param name="to">The 'to' <see cref="DateTime"/>.</param>
        /// <param name="basePath">The TFS resource base path (starting $/project/...).</param>
        /// <returns>An <see cref="IEnumerable{T}"/> where T is <see cref="Changeset"/></returns>
        IEnumerable<Changeset> GetChangeSets(DateTime from, DateTime to, string basePath = null);

        ///// <summary>
        ///// Gets the branches for the <see cref="CurrentProject"/> selected..
        ///// </summary>
        ///// <returns>An <see cref="IEnumerable{T}"/> where T is <see cref="BranchObject"/></returns>
        //IEnumerable<BranchObject> GetBranches();

        IEnumerable<Item> GetFolders(string basePath = null);


        /// <summary>
        /// Get all work item types allowed in the <see cref="CurrentProject"/>.
        /// </summary>
        /// <returns>An <see cref="IEnumerable{T}"/> where T is <see cref="string"/></returns>
        IEnumerable<string> GetWorkItemTypes();
    }
}
